<?php

if(isset($_GET['path']))
{
	$imagesDir = $_GET['path'];
	$images = glob( "../". $imagesDir . '*.{jpg,jpeg,png,gif}', GLOB_BRACE);
	
?>
	<div >
		<p>
		<?php 
			$i = 1;
			foreach ($images as $image)
			{
				$image = substr($image, 3);
		?>			
					<a class="fancybox" href="<?php echo $image; ?>" data-fancybox-group="gallery" title="Lorem ipsum dolor sit amet"><?php echo $i ?></a> |
				
		<?php
				$i++; 		
			}
		?>
		</p>
	</div>
<?php 
}
?>